package charactor;

import java.io.PrintStream;
import java.io.UnsupportedEncodingException;
import java.util.Scanner;

public class sushu {
    public static void main(String[] args) throws UnsupportedEncodingException {
        Scanner input = new Scanner(System.in,"UTF-8");
        PrintStream out = new PrintStream(System.out, true, "UTF-8");
        int count = 0;
        if (input.hasNextInt()) {
            int number = input.nextInt();
            if (number > 10000 || number < 2) {
                out.println("用户输入数字超过范围，请重新输入。");
            } else {
                for (int i = 2; i <= number; i++) {
                    if (isPrimeNormal(i)) {
                        count++;
                        System.out.printf("%5d", i);
                        if (count == 15) {
                            System.out.println();
                            count = 0;
                        }

                    }
                }
            }

        } else {
            out.println("用户输入数据格式错误，请重新输入。");
        }

    }

    public static boolean isPrimeNormal(int num) {
        for (int i = 2; i < num; i++) {
            if (num % i == 0) {
                return false;
            }
        }

        return true;
    }
}
